The Essence of Principal Typings
نویسنده
چکیده
Let S be some type system. A typing in S for a typable term M is the collection of all of the information other than M which appears in the final judgement of a proof derivation showing that M is typable. For example, suppose there is a derivation in S ending with the judgement A ` M : τ meaning that M has result type τ when assuming the types of free variables are given by A. Then (A, τ ) is a typing for M . A principal typing in S for a term M is a typing for M which somehow represents all other possible typings in S for M . It is important not to confuse this notion with the weaker notion of principal type often mentioned in connection with the Hindley/Milner type system. Previous definitions of principal typings for specific type systems have involved various syntactic operations on typings such as substitution of types for type variables, expansion, lifting,
منابع مشابه
Sound and complete inter-checking The very essence of principal typings
This paper brings together the two notions of inter-checking and principal typing , due in their more general formulation to Cardelli and Wells, respectively. Despite a deep interconnection between these two notions is commonly recognized, this is the first attempt at rigorously studying and establishing a relation between them. To this aim, we formalize the notion of sound and complete inter-c...
متن کاملML Has Principal Typings
Is there a type system for core-ML that, using exactly the same syntax of types of the Damas-Milner system, types exactly the same terms of this system, and has principal typings? In this article we answer this question affirmatively. A definition of principal typing is given, capturing the simple idea of representing the set of all typings that can be obtained in derivations for a given term i...
متن کاملPrincipal Typings and True Rank 2 Intersection Typable Recursive Definitions
We propose new typing rules for assigning rank 2 intersection types to (possibly mutually) recursive definitions. A major achievement of the new rules over previous proposals is that they allow to type also true rank 2 intersection typable recursive definitions (i.e., recursive definitions that have a rank 2 intersection type and no simple type). A notable feature of these rules is that they re...
متن کاملPrincipality and type inference for intersection types using expansion variables
Principality of typings is the property that for each typable term, there is a typing from which all other typings are obtained via some set of operations. Type inference is the problem of finding a typing for a given term, if possible. We define an intersection type system which has principal typings and types exactly the strongly normalizable λ-terms. More interestingly, every finite-rank res...
متن کاملWhat Are Principal Typings and What Are They Good For? Technical Memorandum Mittlcsstmm532
We demonstrate the pragmatic value of the principal typing property, a property more general than ML's principal type property, by studying a type system with principal typings. The type system is based on rank 2 intersection types and is closely related to ML. Its principal typing property provides elegant support for separate compilation, including \smartest recompilation" and incremental typ...
متن کامل